package cn.edu.hunan.pm.service;
import cn.edu.hunan.pm.Entity.Patent;
import cn.edu.hunan.pm.mapper.PatentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PatentService {
    @Autowired
    private PatentMapper patentMapper;

    public List<Patent> getAllPatents() {
        return patentMapper.findAll();
    }

    public void addPatent(Patent patent) {
        patentMapper.insert(patent);
    }

    public void updatePatent(Patent patent) {
        patentMapper.update(patent);
    }

    public void deletePatent(int patentID) {
        patentMapper.delete(patentID);
    }
}
